package com.czxy.service;

import com.czxy.mapper.CategoryMapper;
import com.czxy.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * @author 张青卯
 */
@Service
public class CategoryService {

    private final CategoryMapper categoryMapper;

    @Autowired
    public CategoryService(CategoryMapper categoryMapper) {
        this.categoryMapper = categoryMapper;
    }

    /**
     * categorys 根据父ID查询子ID
     * @return List<Category>
     */
    public List<Category> categorys(){
        return categoryMapper.selectAll();
    }

}
